#include "shm.hpp"
#include "NamePipe.hpp"

int main()
{
    //1.获取共享内存
    Shm shm(gpathname, gproj_id, User);
    shm.Zero(); //清空共享内存
    char *shmaddr = (char *)shm.Addr();

    //2.创建管道
    namedpipe pipe(fifo_path, User);
    pipe.OpenForWrite();
    char ch ='A';
    while (ch<'Z')
    {
        shmaddr[ch-'A'] = ch;
        ch++;

        std::string temp = "wakeup";
        pipe.WriteNamedPipe(temp);
        sleep(2);
    }
    return 0;
}